//
//  BHCompetitionApplyBottomView.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/6/16.
//

import UIKit
@objc protocol BHCompetitionApplyBottomViewDelegate: NSObjectProtocol {
    func applyBottomDidSelectIndex(index: Int)
}

class BHCompetitionApplyBottomView: UIView {

    var delegate:  BHCompetitionApplyBottomViewDelegate?
    
    @IBOutlet weak var price_label: UILabel!
    
    @IBOutlet weak var tipImgView: UIImageView!
    
    @IBOutlet weak var applyBtn: UIButton!
    
    static func loadFromXib() -> BHCompetitionApplyBottomView {
        let viewArray = Bundle.main.loadNibNamed("BHCompetitionApplyBottomView", owner: nil, options: nil)
        let view: BHCompetitionApplyBottomView = viewArray![0] as! BHCompetitionApplyBottomView
        return view
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
    
        self.applyBtn.addLayerCorner(25, 0, .white)
        
    }
    
    @IBAction func applyGameAct(_ sender: UIButton) {
        self.delegate?.applyBottomDidSelectIndex(index: 0)
    }
    
    static var viewHeight: CGFloat {
        get {
            return UIScreen.safeBottomHeight+84
        }
    }
    
    
}
